//
//  ZQBaseTableViewController.swift
//  ZQWeibo
//
//  Created by summer的Dad on 16/11/13.
//  Copyright © 2016年 summer的Dad. All rights reserved.
//

import UIKit

class ZQBaseTableViewController: UITableViewController ,ZQVisitroLoginViewDelegate{

    
    var userlogin = ZQUserAccountViewModel.shared.userLogin
    
    
    var  visitroLogin : ZQVisitroLoginView = ZQVisitroLoginView ()
    
    //刚开始创建视图的时候
    override func loadView() {
        
        if userlogin {
            
             super.loadView()
        }
        else
        {
            
            setVisitorView()
        }
    
    }
    
    //定义创建视图方法
   private func setVisitorView () {
    //遵守代理
    visitroLogin.delegate = self
    //设置自定义视图
    view = visitroLogin
    
    
    }
    func userWillLogin() {
        
        print("我要登录")
      let oauth = ZQOAuthViewController()
        
      let navi = ZQNavigationController(rootViewController: oauth)
        
        present(navi, animated: true, completion: nil);
        
    }
    func userWillRegster() {
        print("我要注册")
        
    }
    
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()

   
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }



}
